/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.V300;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class V300Store extends V300 {


    public List<V300> getListV300All(int pnFH000, int pnFH200,int pnFv300, int pnFV200, int pnFK100, String pvLOGIN) {
        try {
            DataStatement data = new DataStatement(PackageContants.LIST_V300, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFv300),
                        new Param(OracleTypes.INTEGER, pnFV200),
                        new Param(OracleTypes.INTEGER, pnFK100),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(data, V300.class);
        } catch (SQLException ex) {
            Logger.getLogger(V300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(V300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(V300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public int updateV300(int pnPV300, int pnFH000, int pnFH200, int pnFK100, int pnFV200, String pvVV301, double pnVN302, String pvVV303, String pvVV304, String pvVV305, String pvLOGIN) {
        DataStatement dataStetament = new DataStatement(PackageContants.UPDATE_V300, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPV300),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFK100),
                    new Param(OracleTypes.INTEGER, pnFV200),
                    new Param(OracleTypes.CHAR, pvVV301),
                    new Param(OracleTypes.DOUBLE, pnVN302),
                    new Param(OracleTypes.CHAR, pvVV303),
                    new Param(OracleTypes.CHAR, pvVV304),
                    new Param(OracleTypes.CHAR, pvVV305),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.update(dataStetament, V300.class);
        } catch (SQLException ex) {
            Logger.getLogger(V300Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
}
